package com.woniuxy.secondkill.productor;

import com.woniuxy.secondkill.configuration.RabbitMQConfiguration;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @Author zhangyong
 * @Date 2021/8/13 0013上午 11:28
 */
@Component
public class KillProductor {
    @Resource
    private AmqpTemplate amqpTemplate;

    public void send(String account){
        //发消息
        amqpTemplate.convertAndSend(
                RabbitMQConfiguration.BUSINESS_EXCHANGE,
                RabbitMQConfiguration.BUSINESS_ROUTING_KEY,
                account
        );
    }
}
